/**
 * Created by 白雨浓 on 2018/1/13 13:50.
 */

const Window = {
    install(Vue){
        const width = document.documentElement.clientWidth;
        const height = document.documentElement.clientHeight;
        const onChange = (callback) => {
            window.onresize = () => {
                callback(document.documentElement.clientWidth,
                    document.documentElement.clientHeight);
            }
        };

        Vue.prototype.$window = {
            width, height, onChange
        }
    }
};

export default Window;